//$cat my_stdio.h
#pragma once
#include <stdio.h>
#define SIZE 1024
#define FLUSH_NONE (1<<0)
#define FLUSH_LINE (1<<1)
#define FLUSH_FULL (1<<2)

typedef struct IO_FILE
{
  int flag; 
  int flagno; //标识符

  int flush_method;
  char outbuffer[SIZE];
  int bufferlen;
}MyFile;


MyFile* MyFopen(const char* path, const char* mode);
int MyFwrite(MyFile* mstream, void* ptr, int size);
void MyFclose(MyFile* mstream);
void MyFFlush(MyFile* mstream);




